refactor(tools): 台帳65列をレビューし、人/AI が書く列を12列に整理 - #1897
Merged
Conversation
65列を棚卸しし、人/AI が埋めていた25列のうち実装から決まる6列を機械化した。 query_params / body_params / request_content_type AST(request.args/get_json/form) oauth_scope @require_oauth_scopes の引数 cache_ratelimit @limiter.limit / cache api_version uri から導出 test_file (--with-test-file) impl_func でテストを検索 add_cols.py 等と同じく **空欄/TODO のセルだけ**を埋める。例外として --fix-oauth-scope は oauth_scope に入っているスコープでない値を - に戻す (手入力で 253 行に admin-role-table が入っており、列の意味の取り違えだった)。 判定は「<資源>:<操作> を1つでも含むか」とし、注記付きの正当な値を落とさない。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HXo9u6PoTf6VRKr3aiGvZ3
台帳の列統合(65列 → 62列)に合わせてスクリプトを更新した。 - add_cols.py / add_ssrf_redirect.py / add_idempotency.py / add_dataop4.py / add_authmech.py の列参照を位置(c[2], c[41] 等)から列名に変更。列を統合すると 位置がずれて壊れるため。add_authmech.py の c[41]=sec_pattern、probe.py の c[41] が該当していた。置換前後で台帳に変化がないことを確認済み。 - add_dataop4.py の書き込み先を data_op_detail → data_op に変更。 - prioritize.py / build_checklist.py を統合後の列名(access_variance / data_store / data_op)に追随させた。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HXo9u6PoTf6VRKr3aiGvZ3
API インベントリ差分(件数のみ)
ベースラインとの差分API インベントリ差分レポート
判定: ✅ PASS (FAIL 0 / WARN 1)サマリ
[WARN] W6 依存パッケージの版が変化した — 3件
台帳との突き合わせスナップショット ↔ インベントリ 突き合わせ
判定: ✅ 一致 (0件)
|
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要 (Summary)
台帳の65列をレビューし、人/AI が書かなければならない列を必要十分に整理しました。ツールとドキュメントのみで、アプリケーションコードへの変更はありません。
PR #1896 のマージ後に積んだ2コミットです。
変更タイプ (Type of Change)
1. 機械化(6列)—
add_reqinfo.pyを追加実装から決まる列を人手で埋めていたのをやめ、AST とデコレータから機械付与します。
query_paramsrequest.args.get等の参照キーbody_paramsrequest.get_json/request.formrequest_content_typeoauth_scope@require_oauth_scopes(...)の引数cache_ratelimit@limiter.limit(...)api_versiontest_file(--with-test-file)impl_funcでテストを検索他の機械付与スクリプトと同じく 空欄/
TODOのセルだけを埋め、既存値は上書きしません。誤値の是正
oauth_scopeの 253行にadmin-role-tableが入っていました。これは認証方式(auth_method/auth_mechanismが保持)であって OAuth スコープではなく、列の意味を取り違えた手入力です。--fix-oauth-scopeで-に戻しました。判定は「<資源>:<操作>を1つでも含むか」とし、注記付きの正当な値(deposit:write(Authorizationヘッダ使用時)、invalid_scope(存在しないスコープ))は残しています。2. 列参照を位置から列名へ
add_authmech.pyがc[41](=sec_pattern)を位置で参照しており、列を統合するとずれて壊れる状態でした。5本すべてを列名参照に変更しています。置換の前後で台帳に変化がないこと(等価性)を確認済みです。
3. 列の統合(台帳側、65 → 62)
access_varianceauth_response_variance+restricted_contentdata_storedata_target+data_storedata_opdata_op_detail+data_opadd_dataop4.pyの書き込み先をdata_op_detail→data_opに、prioritize.py/build_checklist.pyを統合後の列名に追随させました。人/AI が書く列(必要十分)— 12列
summary/roles/access_variance/data_store/side_effects/config_deps/deprecated/notes/sec_pattern/sec_detail/sec_exposed/sec_evidence最後の4列が調査の本体です。
response/status_codes/category_tagsは AST の一次抽出で足り、人は精査のみになります。動作検証
補足
台帳そのものは public な本リポジトリに含まれていません。これらのスクリプトは
WEKO_API_INVENTORY_DIRが指す秘密の場所の台帳を読み書きします。台帳側の変更は別リポジトリに反映済みです。